package com.houger.license;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;

/**
 * @author m678709
 */
@Slf4j
public class StorageStartAppClassNameListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent> {
 
    @Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
        String StartAppClassName = event.getSpringApplication().getMainApplicationClass().getName();
        log.error("StartAppClassName={}", StartAppClassName);
        System.setProperty("StartAppClassName", StartAppClassName);
        System.out.println(System.getProperty("StartAppClassName"));
    }
	
}